package com.brainhealth.customer.service.impl;

import com.brainhealth.common.utils.DateUtils;
import com.brainhealth.customer.domain.ChatErnieBotRecord;
import com.brainhealth.customer.domain.vo.ChatAiVO;
import com.brainhealth.customer.mapper.ChatErnieBotRecordMapper;
import com.brainhealth.customer.service.IChatErnieBotRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文心一言聊天记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-14
 */
@Service
public class ChatErnieBotRecordServiceImpl implements IChatErnieBotRecordService
{
    @Autowired
    private ChatErnieBotRecordMapper chatErnieBotRecordMapper;

    /**
     * 查询文心一言聊天记录
     * 
     * @param id 文心一言聊天记录主键
     * @return 文心一言聊天记录
     */
    @Override
    public ChatErnieBotRecord selectChatErnieBotRecordById(Long id)
    {
        return chatErnieBotRecordMapper.selectChatErnieBotRecordById(id);
    }

    /**
     * 查询文心一言聊天记录列表
     * 
     * @param chatErnieBotRecord 文心一言聊天记录
     * @return 文心一言聊天记录
     */
    @Override
    public List<ChatErnieBotRecord> selectChatErnieBotRecordList(ChatErnieBotRecord chatErnieBotRecord)
    {
        return chatErnieBotRecordMapper.selectChatErnieBotRecordList(chatErnieBotRecord);
    }

    @Override
    public ChatAiVO getChatErnieBotVO(ChatErnieBotRecord chatErnieBotRecord) {
        return chatErnieBotRecordMapper.getChatErnieBotVO(chatErnieBotRecord);
    }

    /**
     * 新增文心一言聊天记录
     * 
     * @param chatErnieBotRecord 文心一言聊天记录
     * @return 结果
     */
    @Override
    public int insertChatErnieBotRecord(ChatErnieBotRecord chatErnieBotRecord)
    {
        chatErnieBotRecord.setCreateTime(DateUtils.getNowDate());
        return chatErnieBotRecordMapper.insertChatErnieBotRecord(chatErnieBotRecord);
    }

    /**
     * 修改文心一言聊天记录
     * 
     * @param chatErnieBotRecord 文心一言聊天记录
     * @return 结果
     */
    @Override
    public int updateChatErnieBotRecord(ChatErnieBotRecord chatErnieBotRecord)
    {
        chatErnieBotRecord.setUpdateTime(DateUtils.getNowDate());
        return chatErnieBotRecordMapper.updateChatErnieBotRecord(chatErnieBotRecord);
    }

    /**
     * 批量删除文心一言聊天记录
     * 
     * @param ids 需要删除的文心一言聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteChatErnieBotRecordByIds(Long[] ids)
    {
        return chatErnieBotRecordMapper.deleteChatErnieBotRecordByIds(ids);
    }

    /**
     * 删除文心一言聊天记录信息
     * 
     * @param id 文心一言聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteChatErnieBotRecordById(Long id)
    {
        return chatErnieBotRecordMapper.deleteChatErnieBotRecordById(id);
    }
}
